package work.xiaohong.websocket.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY;

@Schema(name = "SingleMessage")
@Data
public class SingleMessage implements Serializable{

    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @Schema(description = "主键id",accessMode = READ_ONLY,required = true)
	private BigInteger id;//主键id

    @Schema(description = "发送者",required = true)
    @TableField("sender")
	private BigInteger sender;//发送者

    @Schema(description = "接收者",required = true)
    @TableField("receiver")
	private BigInteger receiver;//接收者

    @Schema(description = "消息内容",required = true)
    @TableField("context")
	private String context;//消息内容

    @Schema(description = "消息类型",required = true)
    @TableField("type")
	private Integer type;//消息类型

    @Schema(description = "消息状态",required = true)
    @TableField("status")
	private Integer status;//消息状态

    @Schema(description = "发送时间",required = true)
    @TableField("send_time")
    private Date sendTime;//发送时间

    @Schema(description = "创建时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
	private Date gmtCreate;//创建时间

    @Schema(description = "更改时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_modified",fill = FieldFill.INSERT_UPDATE)
	private Date gmtModified;//更改时间

    @Schema(description = "乐观锁",accessMode = READ_ONLY)
    @Version
	private Integer version;//乐观锁

    @Schema(description = "逻辑删除标志",accessMode = READ_ONLY)
    @TableLogic
	private Integer deleted;//逻辑删除标志


}

